import time

import pytest
from selenium import webdriver
from Base.Base import Base
from Page.Page import Page

@pytest.fixture(scope='class')
def driver():
    driver = webdriver.Edge()
    driver.get('https://www.sogou.com/')
    driver.implicitly_wait(10)
    driver.maximize_window()
    yield driver
    time.sleep(2)
    driver.quit()

def test_case(driver):
    po = Page(driver)
    print(po.is_search_in())
    time.sleep(2)
    po.send_search()
    po.click_search_botton()
    time.sleep(2)
    print(po.get_search_text())
    assert "软件测试" in po.get_search_text()
    time.sleep(2)
    po.click_tow()
    time.sleep(2)
    print(po.get_tow_text())
    assert "软件测试" in po.get_tow_text()



